package com.xuln.common.category.service;

import java.util.List;
import java.util.Locale;

import com.xuln.common.category.entity.Category;
import com.xuln.framework.service.IBaseService;

public interface ICategoryService extends IBaseService {
	/**
	 * 保存
	 * 
	 * @param category
	 */
	public void save(Category category);

	/**
	 * 更新
	 * 
	 * @param category
	 */
	public void update(Category category);

	/**
	 * 更新
	 * 
	 * @param category
	 */
	public void delete(Long categoryId);

	/**
	 * 读取所有分类
	 * 
	 * @param locale
	 * @return
	 */
	public List<Category> loadAll(Locale locale);

	/**
	 * 得到单个类别
	 * 
	 * @param categoryId
	 * @param locale
	 * @return
	 */
	public Category getCategory(Long categoryId, Locale locale);

	/**
	 * 得到某一类型的所有分类，如文章分类
	 * 
	 * @param type
	 * @param locale
	 * @return
	 */
	public List<Category> getAllCategoryByType(String type, Locale locale);

	/**
	 * 得到所有子类
	 * 
	 * @param categoryId
	 * @param locale
	 * @return
	 */
	public List<Category> getChildCategory(Long categoryId, Locale locale);

	/**
	 * 得到所有子类
	 * 
	 * @param categoryId
	 * @param locale
	 * @return
	 */
	public List<Category> getAllChildCategory(Long categoryId, Locale locale);

	/**
	 * 得到所有父类
	 * 
	 * @param categoryId
	 * @param locale
	 * @return
	 */
	public List<Category> getAllParent(Long categoryId, Locale locale);

}
